package com.small.xx.ai.spring.toolcall.component.time.method;

import com.small.xx.ai.spring.toolcall.component.time.TimeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;

public class TimeTools {

    private static final Logger logger = LoggerFactory.getLogger(TimeTools.class);

    @Tool(description = "获取指定城市的时间。")
    public String getCityTimeMethod(@ToolParam(description = "时区ID, 例如：Asia/Shanghai") String timeZoneId) {
        logger.info("The current time zone is {}", timeZoneId);
        System.out.println("TimeTools.getCityTimeMethod");
        System.out.println("timeZoneId = " + timeZoneId);
        return String.format("当前的时区ID是： %s ，当前的时间是： " + "%s", timeZoneId,
            TimeUtils.getTimeByZoneId(timeZoneId));
    }
}
